package com.xinan.dmgl.fugl;

import com.jfinal.ext.plugin.tablebind.TableBind;
import com.jfinal.kit.StringKit;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;

import java.sql.Timestamp;
import java.util.List;
import java.sql.Date;

@TableBind(tableName = "hygl_fwgl")
public class HyglFwgl extends Model<HyglFwgl>{
    public static final HyglFwgl dao = new HyglFwgl();

    //columns START
    private String ID = "id";  //
    private String FWZL = "fwzl";  //服务种类
    private String FWJG = "fwjg";  //服务价格
    private String GRTC = "grtc";  //工人提成
    private String SPTCFS="sptcfs";
    private String YXBZ="yxbz";

    public void setId(int value) {
        set(ID, value);
    }

	public int getId() {
		return get(ID);
	}
    public void setFwzl(String value) {
        set(FWZL, value);
    }

	public String getFwzl() {
		return get(FWZL);
	}
    public void setFwjg(String value) {
        set(FWJG, value);
    }

	public String getFwjg() {
		return get(FWJG);
	}
    public void setGrtc(String value) {
        set(GRTC, value);
    }

	public String getGrtc() {
		return get(GRTC);
	}
	
	public String getSPTCFS() {
		return SPTCFS;
	}

	public void setSPTCFS(String sPTCFS) {
		SPTCFS = sPTCFS;
	}

	public String getYXBZ() {
		return YXBZ;
	}

	public void setYXBZ(String yXBZ) {
		YXBZ = yXBZ;
	}
	//columns END

    public List<HyglFwgl> findAll() {
        return find("select * from hygl_fwgl");
    }
    /**
     * @param   where
     * @return  Record
     */
    public List<Record> findAlls(String where) {
        String sqlExp = " from hygl_fwgl";
        if(StringKit.notBlank(where)){
                sqlExp += " where " + where;
        }
                return Db.find( "select * " +sqlExp );

    }

    public Page<HyglFwgl> page(int pageNumber, int pageSize, String where) {
        String sqlExp = "from hygl_fwgl";
        if(StringKit.notBlank(where)){
            sqlExp += " where " + where;
        }
        return paginate(pageNumber, pageSize, "select *", sqlExp);
    }

	
}

